package org.example.listener;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class UserNameListener {
    @RabbitListener(bindings = @QueueBinding(
            value=@Queue(name="username.success.queue" ,durable = "true"),
            exchange = @Exchange(name="username.direct"),
            key = "username.success"
    ))
    public void listen(String msg){
        System.out.println("trade receive msg:"+msg);
    }
}
